package com.aepona.app;


import com.aepona.app.client.AppWS;
import com.aepona.app.client.AppWSImplService;

import javax.xml.ws.WebServiceException;


/**
 * Created by IntelliJ IDEA.
 * User: tg40286
 * Date: Mar 21, 2012
 * Time: 5:42:04 PM
 */
public class AppWSC {

    AppWS appWS;

    public AppWSC() {

        try {
            appWS = new AppWSImplService().getAppWSImplPort();
        } catch (WebServiceException e) {
            System.out.println("Failed to access the Web Server !! \n" + e.toString());
        }
    }

    public String loginWS(String username, String password) {

        try {
            return appWS.doLogin(username, password);
        } catch (NullPointerException ex) {
            return "-99|Connection Fail";
        } catch (Exception ex) {
            System.out.println(ex.toString());
            return "-99|Connection Fail";
        }
    }
}
